package com.abl.controller.system;

import com.abl.domain.model.Param;
import com.abl.domain.model.SRS;
import com.abl.controller.BaseController;
import com.abl.service.system.SysDictService;
import com.abl.common.security.annotation.ResC;
import com.abl.common.security.annotation.ResM;
import com.alibaba.fastjson2.JSONObject;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@ResC("字典管理")
@Tag(name = "字典管理")
@RestController
@RequestMapping("/system/dict")
public class SysDictController extends BaseController {
    @Autowired
    private SysDictService service;

    @ResM("新增")
    @PostMapping({"/add"})
    public SRS<Object> add(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(service.add(param));
    }

    @ResM("删除")
    @PostMapping({"/del"})
    public SRS<Object> del(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(service.del(param));
    }

    @ResM("修改")
    @PostMapping({"/edit"})
    public SRS<Object> edit(@RequestBody Param<JSONObject> param) {
        return SRS.bySuccess(service.edit(param));
    }


    @ResM("查询集合")
    @PostMapping({"/list"})
    public SRS<Object> list(@RequestBody Param<JSONObject> param) {
            return SRS.bySuccess(service.list(param));
    }


}
